package com.niit.onlinemusicserver.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.niit.onlinemusicserver.mapper.CollectMapper;
import com.niit.onlinemusicserver.common.R;
import com.niit.onlinemusicserver.model.domain.Collect;
import com.niit.onlinemusicserver.service.CollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CollectServiceImpl extends ServiceImpl<CollectMapper, Collect> implements CollectService {
  @Autowired
  private CollectMapper collectMapper;
  @Override
  public R collectionOfUser(Integer userId) {
    QueryWrapper<Collect> queryWrapper = new QueryWrapper();
    queryWrapper.eq("user_id",userId);
    return R.success("用户收藏", collectMapper.selectList(queryWrapper));

  }
}